package model
{
	import mx.collections.ArrayCollection;

	public class ChatbotModel
	{
		[Bindable]
		public var userName:String = "";
		[Bindable] 
		public var messages:ArrayCollection = new ArrayCollection();
		[Bindable] 
		public var chatHistory:ArrayCollection = new ArrayCollection();
		[Bindable] 
		public var symbolPattern:RegExp = /\$|\?|\^|\*|\(|\)|\{|\[|\||\\|\<|\>|\.|!|@|#|%|&|=|}|]|:|;|"|,|\/|_|\+|-/g;
		[Bindable] 
		public var multiSpace:RegExp = /\s+/g;
		[Bindable] 
		public var spaceAtEnd:RegExp = /\s+?$/g;
		[Bindable] 
		public var spaceAtBeg:RegExp = /^\s/;
		[Bindable] 
		public var questionMark:RegExp = /\?/;
		[Bindable]
		public var questionWord:RegExp = /whence|where|which|whose|what|when|whom|who|how|why/gi;
		[Bindable] 
		public var positive:RegExp = /(not so bad)|(not that bad)|yes|sure|yay|ok|fine|good/gi;
		[Bindable] 
		public var negative:RegExp = /nopes|nope|not|no|nah|wrong/gi;
		[Bindable]
		public var stopWords:Array = new Array("a", "an", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "'s", "it", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "'ll", "with");
		[Bindable]
		public var positiveAnswers:ArrayCollection;
		[Bindable] 
		public var negativeAnswers:ArrayCollection;
		[Bindable] 
		public var neutralAnswers:ArrayCollection;
		[Bindable] 
		public var questionAnswers:ArrayCollection;
		[Bindable] 
		public var sorryAnswers:ArrayCollection;
		
		public function initAnswers():void
		{
			positiveAnswers = new ArrayCollection();
			positiveAnswers.addItem("Alright! Ask me a question.");
			positiveAnswers.addItem("That's ok. Ask me something.");
			positiveAnswers.addItem("I'm enjoying this. Ask me something.");
			positiveAnswers.addItem("Ok. Ask me anything.");
			positiveAnswers.addItem("Really? Come on, ask me something.");
			
			negativeAnswers = new ArrayCollection();
			negativeAnswers.addItem("Sorry. Let's try something else.");
			negativeAnswers.addItem("I can do better than this. Ask me something.");
			negativeAnswers.addItem("I'll remember that. Ask me something.");
			
			neutralAnswers = new ArrayCollection();
			neutralAnswers.addItem("Ask me a question.");
			neutralAnswers.addItem("We can go on forever like this, ask me something.");
			neutralAnswers.addItem("Anyway. Ask me a question.");
			neutralAnswers.addItem("Seriously, ask me something.");
			
			questionAnswers = new ArrayCollection();
			questionAnswers.addItem("Was this the answer you were looking for?");
			questionAnswers.addItem("Is this ok?");
			questionAnswers.addItem("How was that, eh?");
			questionAnswers.addItem("Am I right?");
			questionAnswers.addItem("I'm not sure about this though.");
			
			sorryAnswers = new ArrayCollection();
			sorryAnswers.addItem("Sorry, I don't know anything about that.");
			sorryAnswers.addItem("I don't know.");
			sorryAnswers.addItem("Ugh, what is that? I don't know what it is.");
			sorryAnswers.addItem("Haven't heard of it.");
			sorryAnswers.addItem("I can't answer that.");
			sorryAnswers.addItem("No idea.");
		}
	}
}